package com.example.demo4.repository;

import com.example.demo4.domain.Student;

import org.springframework.data.domain.Sort;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;

import javax.transaction.Transactional;
import java.util.List;

public interface StudentRepository extends JpaRepository<Student,Integer> {
    // Repository 自动生成的方法 一定要对应 数据库的字段名

    // Teacher update(Teacher teacher);

    @Modifying
    @Transactional




    List<Student> findByNameLike(String name);

}
